package com.kdgc.ibatis.sqlsession;

import com.kdgc.ibatis.config.Configuration;
import com.kdgc.ibatis.sqlsession.SqlSession;
import com.kdgc.ibatis.sqlsession.SqlSessionFactory;

/*SqlSessionFactory实现类*/
public class SqlSessionFactoryImpl implements SqlSessionFactory {

    private Configuration cfg;
    public SqlSessionFactoryImpl(Configuration cfg){
        this.cfg=cfg;
    }


    /*用于创建数据库连接 对象*/
    @Override
    public SqlSession OpenSession() {
        return new SqlSessionImpl(cfg);
    }
}
